<script type="text/javascript">
$(function(){
	$.get("inventorymanagement/getMakeCardCompany",function(data){
		var contenta="<option value='' selected>请选择</option>";
		var companyList = data.companies;
		for(var i=0;i<companyList.length;i++){
			contenta+="<option value="+companyList[i].companyNo+">"
			+companyList[i].companyName+"</option>"
		}
		$("#makeCardCompanyByInventory").html(contenta);	
	},"json");
	
	$("#makeCardCompanyByInventory").change(function(){
		var companyCode = $("select[name='makeCardCompanyByInventory']").val();
		var companyName = $("select[name='makeCardCompanyByInventory'] option[value='"+companyCode+"']").html();
		$("input[name='companyName']").val(companyName);
	});
	
	$("#returnFilePath").on("change",function(){
        filePath=$(this).val();
        $("input[name='filePathByReturnCard']").val(filePath);
    });
	
}); 

function validateCheckBox(){
	if($("input[name='returnFileInfo']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")
		 return false;
	}
}
</script>

<div class="pageHeader ">
	<form id="addFile" method="post" action="inventoryMagOfReturnFileImport/addFileList" class="pageForm required-validate" onsubmit="return validateCallback(this,addFileList);">
		<!-- <input type="hidden" name="pageCount" value="" /> -->
		<div class="searchBar">
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-8 col-sm-12">
					<p>
						<label>文件选择：</label>
						<input type="file" id="returnFilePath" name="returnFilePath"  multiple="multiple" accept="text/plain" style="width:400px;height:20px;" class="validRequired">
						<input type="hidden" value="" name="filePathByReturnCard"/>
					</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<p>
						<label>制卡商：</label>
						<select name="makeCardCompanyByInventory" id="makeCardCompanyByInventory" class="validRequired">
						</select>
						<input name="companyName" value="" type="hidden"/>
					</P>
				</div>
			</div>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit" onclick="return checkReturnFileRepeat();">加入清单</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>	
</div>

<form method="post" action="inventoryMagOfReturnFileImport/importReturnFileRegister" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);">
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li><a class="delete" onclick="return deleteReturnFile(this);" param="EmpReturn"><span>删除</span></a></li>
			</ul>
		</div>
		<div id="tableInfoByReturnFile">
		<table class="table" width="100%" layoutH="258">
			<thead>
				<tr align="center">
					<th width="5%"><input type="checkbox" onclick="checkAllCss(this)" name="" group="returnFileInfo" class="checkboxCtrl"></th>
					<th width="5%" >序号</th>
					<th width="45%" >文件名称</th>
					<th width="25%" >制卡商</th>
				</tr>
			</thead>
			<tbody id="tbodyByReturnFile">
				
			</tbody>
		</table>
		</div>
	 <div class="formBar">
		<ul> 
			<li>
				<div class="buttonActive" >
					<div class="buttonContent" ><button type="submit" onclick="return validateCheckBox();">导入</button></div>	
				</div>
				<span style="padding-left: 20px"></span>
			</li>
		</ul>
	</div> 
	</div>		
</form>
	

